package java2020spring;
import java.awt.event.*;
import javax.swing.*;
public class Mouse implements MouseListener{
	JTextArea txt;
	public void setTxt(JTextArea area) {
		txt=area;
	}
	public void mouseClicked(MouseEvent e) {
		if(e.getSource()=="copy")
			txt.copy();
		if(e.getSource()=="zhantie")
			txt.paste();
		if(e.getSource()=="cut")
			txt.cut();
	}

	@Override
	public void mousePressed(MouseEvent e) {
		if(e.getSource()=="copy")
			txt.copy();
		if(e.getSource()=="zhantie")
			txt.paste();
		if(e.getSource()=="cut")
			txt.cut();
		
	}
	public void mouseReleased(MouseEvent e) {}
	public void mouseEntered(MouseEvent e) {}
	public void mouseExited(MouseEvent e) {}
}
